/**
 * author:Administrator
 * date:2016/2/24
 * desc:TODO
 */
'use strict';

let seq = 1;
let list = {};

class LocationRepoImpl {

  static * genId() {
    return 'loc_' + (seq++);
  }

  static * find(id) {
    return list[id];
  }

  static *store(loc) {
    if (!loc.id) loc.id = yield LocationRepoImpl.genId();
    list[loc.id] = loc;
  }

}
module.exports = LocationRepoImpl;